#!/usr/bin/env bash

# 包含语句文件
source $PWD/base/statement.sh
# 包含命令文件
source $PWD/base/command.sh

if [ "$(uname)" == "Darwin" ]; then
	echo "Mac System"
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ] && [ $server == $mysqlServer ]; then
	echo "Linux System"
	$connect_local_root_user -e "
		$set_validate_password_policy
		$set_validate_password_length
	" -N
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
	echo "Windows System"
fi

# 使用root用户创建用户、数据库并分配权限
$connect_local_root_user -e "
	$drop_database
	$drop_user
	$create_database
	$create_user
	$grant_dba_privilege
	$grant_table_privilege
	$grant_other_privilege
	$flush_privilege
" -N

read -p ""
